<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String basePath = request.getContextPath(); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<base href="<%=request.getContextPath()%>/" />
    <link rel="stylesheet" type="text/css" href="Styles/admin-all.css" />
    <link rel="stylesheet" type="text/css" href="Styles/base.css" />
    <link rel="stylesheet" type="text/css" href="Styles/bootstrap.min.css" />
<title>后台管理系统</title>
</head>
<body>
<table class="table table-hover">
  <caption>公文</caption>
  <thead>
    <tr>
      <th>主题</th>
      <th>级别</th>
      <th>详情</th>
    </tr>
  </thead>
  <tbody>
  <c:forEach items="${cg}" var="gw">
    <tr>
      <td>${gw.title}</td>
      <td><c:if test="${gw.grade==1}"><p>常规公文</p></c:if>
         <c:if test="${gw.grade==2}"><p>重要公文</p></c:if>
         <c:if test="${gw.grade==3}"><p>特殊公文</p></c:if>
         <c:if test="${gw.grade==4}"><p>紧急公文</p></c:if></td>
      <td><a href="gongwen/dogw?id=${gw.gwId}">详情</a></td>
    </tr>
  </c:forEach>
  </tbody>
</table>
  <div class="pagination" style="float: right;">
        <ul>
					  	<c:if test="${pageno <= 1}">
					  		<li class="disabled"><a>上一页</a></li>
					  	</c:if>
					  	<c:if test="${pageno >1}">
					    	<li><a href="gongwen/lookcg?pageno=${pageno-1}">上一页</a></li>
					    </c:if>
					    <c:forEach var="item" begin="1" end="${count}" step="1">
					    	<c:choose>
					    		<c:when test="${item==pageno }">
					    			<li class="active"><a>${item }</a></li>
					    		</c:when>
					    		<c:otherwise>
					    			<li><a href="gongwen/lookcg?pageno=${item}">${item }</a></li>
					    		</c:otherwise>
					    	</c:choose>
					    	
					    </c:forEach>
					    <c:if test="${pageno < count}">
					    <li><a href="gongwen/lookcg?pageno=${pageno+1}">下一页</a></li>
					  	</c:if>
					  	<c:if test="${pageno >= count}">
					    	<li class="disabled"><a>下一页</a></li>
					  	</c:if>
					  </ul>
					  </div>
</body>
</html>